<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
</head>
<body>
    <div class="m-t-lg">
        <dl class="dl-horizontal">
            <dt>素材名称：</dt>
            <dd class="m-r">
                <span class="fs12 c-4e" th:text="${material['name']}"></span>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>素材专业/科目：</dt>
            <dd class="m-r">
                <th:block th:if="!${#lists.isEmpty(material['subjectList'])}">
                    <span class="fs12 c-4e" th:each="subject,subIndex : ${material['subjectList']}">
                        <th:block th:text="${subject['subjectName']}+'/'"></th:block>
                        <th:block th:if="!${#lists.isEmpty(subject['childSubjectList'])}" th:each="child,index : ${subject['childSubjectList']}">
                            <th:block th:if="${index.last} == false" th:text="${child['subjectName']}+'/'"></th:block>
                            <th:block th:if="${index.last} == true" th:text="${child['subjectName']}"></th:block>
                        </th:block>
                        <th:block th:if="${#lists.isEmpty(subject['childSubjectList'])}">全部科目</th:block>
                        <th:block th:if="${subIndex.last}==false" th:utext="'<br/>'"></th:block>
                    </span>
                </th:block>
                <th:block th:if="${#lists.isEmpty(material['subjectList'])}">
                    <span class="fs12 c-4e">—</span>
                </th:block>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>

        <dl class="dl-horizontal">
            <dt>素材类型：</dt>
            <dd class="m-r">
                <th:block th:each="type:${typeList}">
                    <span class="fs12 c-4e" th:if="${material['typeKey']}==${type.key}" th:text="${type.value}"></span>
                </th:block>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>素材讲师：</dt>
            <dd class="m-r">
                <span class="fs12 c-4e" th:if="${#maps.isEmpty(material['teacher'])}">未关联教师</span>
                <span class="fs12 c-4e" th:if="!${#maps.isEmpty(material['teacher'])}" th:text="${material['teacher']['teacherName']}"></span>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>素材助教：</dt>
            <dd class="m-r">
                <span class="fs12 c-4e" th:if="${#maps.isEmpty(material['assistant'])}">未关联助教</span>
                <span class="fs12 c-4e" th:if="!${#maps.isEmpty(material['assistant'])}" th:text="${material['assistant']['teacherName']}"></span>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>素材播放/浏览状态：</dt>
            <dd class="m-r">
                <span th:if="${material['playStatus']}==0" class="fs12 c-4e label label-danger">未指定</span>
                <span th:if="${material['playStatus']}==1" class="fs12 c-4e label label-info">正常</span>
                <span th:if="${material['playStatus']}==2" class="fs12 c-4e label label-danger">冻结</span>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <dl class="dl-horizontal">
            <dt>素材状态：</dt>
            <dd class="m-r">
                <span th:if="${material['status']}==0" class="fs12 c-4e label label-default">未指定</span>
                <span th:if="${material['status']}==1" class="fs12 c-4e label label-danger">未发布</span>
                <span th:if="${material['status']}==2" class="fs12 c-4e label label-info">已发布</span>
            </dd>
        </dl>
        <div class="hr-line-dashed"></div>
        <div th:if="${material['typeKey']}=='ARTICLE'">
            <dl class="dl-horizontal">
                <dt>文章简介：</dt>
                <dd class="m-r">
                    <span class="fs12 c-4e" th:utext="${material['articleSummary']}"></span>
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
            <dl class="dl-horizontal">
                <dt>文章内容：</dt>
                <dd class="m-r">
                    <span class="fs12 c-4e" th:utext="${material['articleContext']}"></span>
                </dd>
            </dl>
        </div>
        <div th:if="${material['typeKey']}=='AUDIO'">
            <dl class="dl-horizontal">
                <dt>音频服务商：</dt>
                <dd class="m-r">
                    <span class="fs12 c-4e" th:text="${material['playType']}"></span>
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
        </div>
        <div th:if="${material['typeKey']}=='VIDEO'">
            <dl class="dl-horizontal">
                <dt>视频服务商：</dt>
                <dd class="m-r">
                    <span class="fs12 c-4e" th:text="${material['playType']}"></span>
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
        </div>
        <div th:if="${material['typeKey']}=='LIVE'">
            <dl class="dl-horizontal">
                <dt>直播服务商：</dt>
                <dd class="m-r">
                    <span class="fs12 c-4e" >268云服务</span>
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
            <dl class="dl-horizontal">
                <dt>直播间ID：</dt>
                <dd class="m-r">
                    <span class="fs12 c-4e" th:text="${material['roomId']}"></span>
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
            <th:block th:if="${material['playType']}=='CC'">
                <dl class="dl-horizontal">
                    <dt>直播间识别码：</dt>
                    <dd class="m-r">
                        <span class="fs12 c-4e" th:text="${material['playUrl']}"></span>
                    </dd>
                </dl>
                <div class="hr-line-dashed"></div>
                <dl class="dl-horizontal">
                    <dt>管理员地址：</dt>
                    <dd class="m-r">
                        <span class="fs12 c-4e" th:text="${material['adminUrl']}"></span>
                    </dd>
                </dl>
                <div class="hr-line-dashed"></div>
                <dl class="dl-horizontal">
                    <dt>管理员参加码：</dt>
                    <dd class="m-r">
                        <span class="fs12 c-4e" th:text="${material['adminCode']}"></span>
                    </dd>
                </dl>
                <div class="hr-line-dashed"></div>
                <dl class="dl-horizontal">
                    <dt>讲师地址：</dt>
                    <dd class="m-r">
                        <span class="fs12 c-4e" th:text="${material['teacherUrl']}"></span>
                        <input type="hidden" id="teacherUrl" th:value="${material['teacherUrl']}">
                    </dd>
                </dl>
                <div class="hr-line-dashed"></div>
                <dl class="dl-horizontal">
                    <dt>讲师地址二维码：</dt>
                    <dd class="m-r">
                        <div class="col-sm-3">
                            <div class="image">
                                <img alt="讲师地址二维码" id="teacherQRCodeInp" class="img-responsive" th:src="@{{path}/admin/v3/img/default/default-pic.jpg?v={v}(path=${staticPath},v=${v})}"/>
                            </div>
                        </div>
                    </dd>
                </dl>
                <div class="hr-line-dashed"></div>
                <dl class="dl-horizontal">
                    <dt>讲师参加码：</dt>
                    <dd class="m-r">
                        <span class="fs12 c-4e" th:text="${material['teacherCode']}"></span>
                    </dd>
                </dl>
                <div class="hr-line-dashed"></div>
                <dl class="dl-horizontal">
                    <dt>学员地址：</dt>
                    <dd class="m-r">
                        <span class="fs12 c-4e" th:text="${material['studentUrl']}"></span>
                        <input type="hidden" id="studentUrl" th:value="${material['studentUrl']}">
                    </dd>
                </dl>
                    <div class="hr-line-dashed"></div>
                <dl class="dl-horizontal">
                    <dt>学员地址二维码：</dt>
                    <dd class="m-r">
                        <div class="col-sm-3">
                            <div class="image">
                                <img alt="学员地址二维码" id="studentQRCodeInp" class="img-responsive" th:src="@{{path}/admin/v3/img/default/default-pic.jpg?v={v}(path=${staticPath},v=${v})}"/>
                            </div>
                        </div>
                    </dd>
                </dl>
                <div class="hr-line-dashed"></div>
                <dl class="dl-horizontal">
                    <dt>学员参加码：</dt>
                    <dd class="m-r">
                        <span class="fs12 c-4e" th:text="${material['studentCode']}"></span>
                    </dd>
                </dl>
                <div class="hr-line-dashed"></div>
         </th:block>
            <dl class="dl-horizontal" >
                <dt>直播时间：</dt>
                <dd class="m-r">
                    <span class="fs12 c-4e" th:text="${material['liveBeginTime']}+'至'+${material['liveEndTime']}">
                    </span>
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
            <dl class="dl-horizontal">
                <dt>回放地址：</dt>
                <dd class="m-r">
                    <span class="fs12 c-4e" th:text="${material['replayUrl']}"></span>
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
        </div>

            <dl class="dl-horizontal">
                <dt>学员上课记录：</dt>
                <dd class="m-r">
                    <a id="downloadExcel" th:href="@{/admin/course/material/downloadExcel?id={id}(id=${material ['id']})}">
                        <button style="width: 10px;" class="btn btn-block btn-w-m btn-primary" type="button">
                            <i class="fa fa-download"></i> 导出数据
                        </button>
                    </a>
                    <span class="help-block m-b-none c-999">上课记录6小时后生成</span>
                </dd>
            </dl>
            <div class="hr-line-dashed"></div>
            <dl class="dl-horizontal">
                <dt>提前进入时间：</dt>
                <dd class="m-r">
                    <span class="fs12 c-4e" th:text="${material['preEnterTime']}">
                    </span>
                </dd>
            </dl>
        </div>
    </div>
    <div data-th-replace="layout/head-footer"></div>
    <script type="text/javascript" th:src="@{{path}/common/qrcode/jquery.qrcode.min.js?v={v}(path=${staticPath}, v=${v})}"></script>
    <script type="text/javascript">
        $(function () {
            QRCodeInp();
            /**
             * 生成二维码
             * @constructor
             */
            function QRCodeInp(){
                var studentUrl = $('#studentUrl').val();
                if(studentUrl!=null && studentUrl!=''){
                    var qrcode = $('#studentQRCodeInp').qrcode({render: "canvas", height: 140, width: 140, correctLevel: 2, text: studentUrl}).find('canvas').hide();
                    $("#studentQRCodeInp").attr('src', qrcode[0].toDataURL());
                }
                var teacherUrl = $('#teacherUrl').val();
                if(teacherUrl!=null && teacherUrl!=''){
                    var qrcode = $('#teacherQRCodeInp').qrcode({render: "canvas", height: 140, width: 140, correctLevel: 2, text: teacherUrl}).find('canvas').hide();
                    $("#teacherQRCodeInp").attr('src', qrcode[0].toDataURL());
                }

            }
        })
    </script>
</body>
</html>
